
{% block content %}

    <div class="container" style="height: 440px; ">
        <div class="row">
            <div class="col-md-9">
            {% if articles %}
                {% for article in articles %}
                    <h2><a href="{{ article.get_absolute_url }}">{{ article.title }}</a></h2> <br>
                    <p>{{ article.body|truncatechars:80 }}</p>
                    <p>
                        <span>作者：{{ article.author }}</span>
                        <span>&nbsp;&nbsp;&nbsp;&nbsp;发布时间：{{ article.pub_date }}</span>
                        <span>&nbsp;&nbsp;&nbsp;&nbsp;阅读量：{{ article.views }}</span>
                    </p>
                {% endfor %}
            {% else %}
                <p>没有文章。</p>
            {% endif %}
            {# 注释: 下面代码一点也不要动 #}
            {% if is_paginated %}
                <ul class="pagination">
                {% if page_obj.has_previous %}
                    <li class="page-item"><a class="page-link" href="?page={{ page_obj.previous_page_number }}">上一页</a></li>
                {% else %}
                    <li class="page-item disabled"><span class="page-link">上一页</span></li>
                {% endif %}
                {% for i in paginator.page_range %}
                    {% if page_obj.number == i %}
                        <li class="page-item active"><span class="page-link"> {{ i }} <span class="sr-only">(current)</span></span></li>
                    {% else %}
                        <li class="page-item"><a class="page-link" href="?page={{ i }}">{{ i }}</a></li>
                    {% endif %}
                {% endfor %}
                {% if page_obj.has_next %}
                    <li class="page-item"><a class="page-link" href="?page={{ page_obj.next_page_number }}">下一页</a></li>
                {% else %}
                    <li class="page-item disabled"><span class="page-link">下一页</span></li>
                {% endif %}
                 </ul>
            {% endif %}

            </div>

        </div>

    </div>


{% endblock %}